Application acceleration

ABSTRACT

A method of transmitting content from a server to a client executing an application is disclosed. A request from a client for a file that includes content related to executing an application is received. The request is responded to by transmitting a modified file that includes initial portions of the file that are sufficient to permit initial functioning of the application, wherein the modified file is formatted with at least one placeholder for remaining portions of the file. The application can begin to access the initial portions of the file by accessing the modified file. The application can access the remaining portions of the file using the at least one placeholder.

CROSS REFERENCE TO OTHER APPLICATIONS

This application claims priority to U.S. Provisional Patent ApplicationNo. 61/502,742 (Attorney Docket No. INSTP002+) entitled APPLICATIONACCELERATION filed Jun. 29, 2011 which is incorporated herein byreference for all purposes.

BACKGROUND OF THE INVENTION

Some computer applications require the downloading of resources througha client-server connection over a network before the applications canstart. The long startup time may deter some end users from using theapplications. Therefore, improved techniques for downloading theresources for these applications would be desirable.

BRIEF DESCRIPTION OF THE DRAWINGS

Various embodiments of the invention are disclosed in the followingdetailed description and the accompanying drawings.

FIG. 1 is a block diagram illustrating an embodiment of a client-serverconnection through a network for downloading files for starting andloading an application on the client side.

FIG. 2 is a diagram illustrating an embodiment of a SWF file.

FIG. 3 is a diagram illustrating an embodiment of a client-serverconnection through a network for downloading files for starting andloading an application on the client side.

FIG. 4 is a diagram illustrating an embodiment of a process 400 fordownloading a file from a server to a client, wherein the file is forstarting and loading an application on the client side.

FIG. 5 is a diagram illustrating an embodiment of a profiling process500 for determining the initial portions of original startup SWF filesthat are sufficient to permit the initial functioning of the applicationin process 400.

DETAILED DESCRIPTION

The invention can be implemented in numerous ways, including as aprocess; an apparatus; a system; a composition of matter; a computerprogram product embodied on a computer readable storage medium; and/or aprocessor, such as a processor configured to execute instructions storedon and/or provided by a memory coupled to the processor. In thisspecification, these implementations, or any other form that theinvention may take, may be referred to as techniques. In general, theorder of the steps of disclosed processes may be altered within thescope of the invention. Unless stated otherwise, a component such as aprocessor or a memory described as being configured to perform a taskmay be implemented as a general component that is temporarily configuredto perform the task at a given time or a specific component that ismanufactured to perform the task. As used herein, the term ‘processor’refers to one or more devices, circuits, and/or processing coresconfigured to process data, such as computer program instructions.

A detailed description of one or more embodiments of the invention isprovided below along with accompanying figures that illustrate theprinciples of the invention. The invention is described in connectionwith such embodiments, but the invention is not limited to anyembodiment. The scope of the invention is limited only by the claims andthe invention encompasses numerous alternatives, modifications andequivalents. Numerous specific details are set forth in the followingdescription in order to provide a thorough understanding of theinvention. These details are provided for the purpose of example and theinvention may be practiced according to the claims without some or allof these specific details. For the purpose of clarity, technicalmaterial that is known in the technical fields related to the inventionhas not been described in detail so that the invention is notunnecessarily obscured.

FIG. 1 is a block diagram illustrating an embodiment of a client-serverconnection through a network for downloading files for starting andloading an application on the client side. As shown in FIG. 1, a client102 is connected to a server 104 through a network 106. However, anynumber of clients and servers may be connected through network 106.Network 106 may be any combination of public or private networks,including intranets, LANs, WANs, and the Internet. Server 104 sends oneor more files through network 106 to client 102. In some embodiments,the one or more files sent by server 104 to client 102 are filesrequired by client 102 before a process can start to run.

In some embodiments, the process that requires the one or more filesfrom server 104 is a game application. For example, the game applicationcan be a browser game, i.e., a computer game played over the Internetusing a web browser. Browser games include social network games, such asFarmVille, Mafia Wars, FrontierVille, and the like. These social networkgames are online games that are distributed through social networks,e.g., Facebook, and may feature multiplayer gameplay mechanics. Thepopular browser-based social network game, FarmVille, is usedhereinafter as an example for the process or application describedabove. Farmville is selected for illustration purposes only;accordingly, the present application is not limited to this specificexample only.

FarmVille is a farm simulation game available as an application on thesocial networking website Facebook. The game allows members of Facebookto manage a virtual farm by planting, growing, and harvesting virtualcrops and trees, or raising livestock. Before the application can startto run on the client side, one or more SWF (Small Web Format) files aresent by server 104 to client 102 through network 106. These SWF filesprovide the application on the client side with resources it needs forstarting and running the game. SWF can be used to present vector-basedobjects and images, audio, video, text, and other forms of interactionwith the end user. After the one or more SWF files are received on theclient side, the SWF files can be played by an Adobe Flash Player as abrowser plugin. For example, text can be displayed, audio can be played,and movie clips can be played as the game begins.

FIG. 2 is a diagram illustrating an embodiment of a SWF file. A SWF filehas different sections, including the character, symbol table, andtimeline sections. The character section is used to store contents, suchas images, movie clips, audio, and the like. For example, the charactersection of a SWF file sent by a FarmVille server may include image files(e.g., bitmap or jpeg files) and movie clips files (e.g., mpeg files) ofvarious crops that may be planted in the farm, farm animals that can beraised in the farm, and the like. The timeline section has code todefine how the animation of the game should progress over time. Forexample, the timeline may specify that a particular farm animal, e.g., asheep, should be displayed at time t0 at a particular position on thescreen. The symbol section includes code, e.g., actionscripts, forloading the image file (e.g., sheep.jpg or sheep.bmp) of the farm animalfrom the character section. The loaded image can then be displayed onthe screen at the specified time and location. The symbol table sectionalso includes character ID and class name information.

The number of SWF files for starting up FarmVille on the client side andthe content of those SWF files are different for different playerlevels. As the player level increases, the number of SWF files forstarting up FarmVille on the client side and the sizes of those SWFfiles may also increase. This is because some characters are only madeavailable to players at or above a certain player level.

Although each player level has a different set of startup SWF files,players at the same player level receive an identical set of SWF files.The set of startup SWF files for a particular player level is updatedperiodically to incorporate new features or new characters for the game.Since the set of startup SWF files for a particular player level is notdynamically generated for a particular game player by the game publisher(i.e., Zynga), some game players may receive characters in the set ofSWF files that are never used during their respective games. As the size(in bytes) of each image or movie clip file is typically large,receiving unnecessary characters embedded in the set of startup SWFfiles on the client side over a network translates to a long startup orloading time for the game, especially for higher player levels. In somecases, the long startup time can even deter some game players fromplaying the game. Therefore, a technique to speed up the startup timefor a process or application on the client side, without compromisingthe game player's experience, would be desirable.

FIG. 3 is a diagram illustrating an embodiment of a client-serverconnection through a network for downloading files for starting andloading an application on the client side. Continuing with our FarmVilleillustrative example above, the client no longer receives the startupfiles for running the FarmVille browser game directly from server 104(as shown in FIG. 1) but from a server 308 other than server 104. Insome embodiments, server 308 is a server that belongs to a contentdelivery network or content distribution network (CDN). Server 104 hasaccess to the original startup SWF files provided by the game publisherof FarmVille (i.e., Zynga). These original startup SWF files are the SWFfiles that are normally downloaded by the user's browser when the gameis started. Server 308 periodically obtains the most updated version ofthese original startup SWF files from server 104, modifies them, andthen sends the modified startup SWF files (denoted SWF') for aparticular player level to client 102 upon the client's request. Forexample, if server 104 provides three startup SWF files (SWF1, SWF2, andSWF3) for starting the game at a particular player level, then threemodified startup SWF′ files (SWF1′, SWF2′, and SWF3′) are generated byserver 308 and sent to client 102.

The modified startup SWF′ files are smaller in size (measured in bytes)than the original startup SWF files, thereby reducing the downloadingtime of the files and thus the startup time of the application. Themodified startup SWF′ files contain portions of the original startup SWFfiles. These initial portions provide resources for the initialfunctioning of the application. For example, only a portion of thecharacters embedded in the original startup SWF files are required forthe initial functioning of the application. The initial portions foreach player level may be determined empirically. For example, theinitial portions may be determined based on statistics collected byserver 308 in a “profiling” process, which will be described in greaterdetail below.

In some embodiments, the game publisher may include code in the gameapplication to be executed on the game player's machine (e.g., a laptopor smartphone) such that when the game is started, the browser willrequest (e.g., using HTTP requests) for startup files from server 308,instead of from server 104. However, other ways to redirect the filerequests to server 308 may be used as well.

FIG. 4 is a diagram illustrating an embodiment of a process 400 fordownloading a file from a server to a client, wherein the file is forstarting and loading an application on the client side. At 402, arequest for a file that includes content related to executing anapplication is received by a server from a client. For example, therequest is a HTTP request for a startup SWF file containing content thatis related to executing an application, such as a game application.

At 404, in response to the request, a modified file that includesinitial portions of the original file that are sufficient to permitinitial functioning of the application is transmitted from the server tothe client. For example, the initial portions may include a subset ofthe characters embedded in an original startup SWF file provided by thegame publisher. Continuing with the FarmVille illustrative exampleabove, the initial portions may include the image or movie clip files ofthe most commonly planted crops or most commonly raised farm animals,background image files, the FarmVille logo, and the like. The remainingportions of the file are not included in the modified file. In theFarmVille example, the image or movie clip files of some of the lesscommonly planted crops or less commonly raised farm animals are notembedded in the character section of the modified startup SWF′ file.

With continued reference to FIG. 4, after the modified file is received,the application can be executed at 406. Continuing with the FarmVilleillustrative example above, a game player may begin to plant crops inthe virtual farm, and so forth. For example, if the game player choosesto plant a particular crop and the image file for the crop is embeddedin the character section of the modified startup SWF′ file, then theapplication can begin to access the image file locally by accessing themodified startup SWF′ file. If, however, the game player chooses toplant a particular crop and the image file for the crop is not embeddedin the character section of the modified startup SWF′ file, then theimage file is accessed using a placeholder in the modified startup SWF′file.

In particular, the modified file is formatted with at least oneplaceholder for the remaining portions of the file. The at least oneplaceholder allows the application to access the remaining portions ofthe file. In some embodiments, the placeholder may be program code, datastructures, interfaces, or a combination thereof, that allow theapplication to access the remaining portions of the file. As will bedescribed in greater detail below, the remaining portions of the filemay be fetched from one of the following: 1) the server through thenetwork, or 2) a local cache, file system, or memory.

In some embodiments, the modified startup SWF′ file includes programcode, data structures, or interfaces from the original SWF file and alsonew code, data structures, or interfaces that are added by the server.In a SWF or SWF′ file, a character is represented by a class. The classof a character is instantiated by calling the function “new ( )” beforethe character is used in the application. Because a particular charactermay not be actually embedded in the character section of the modifiedSWF′ file, a new class for the character is created. The new class mayimport the same interfaces of the original class. Program code forloading the image includes program code from the original SWF file andalso new code that are added by the server. For example, the originalprogram code that uses the character will call into the new code suchthat before a character is loaded, the character is looked up in one ofthe following three locations: 1) the character section of the modifiedSWF′ files, 2) the server through the network, and 3) a local cache,file system, or memory.

The first location is the character section of the modified SWF′ files.In the FarmVille example, image or movie clip files of some of the mostcommonly planted crops or most commonly raised farm animals, backgroundimage files, the FarmVille logo, and the like, can be embedded in thecharacter section of the modified startup SWF′ file.

The second location is the server. In the FarmVille example, image ormovie clip files of some of the less commonly planted crops or lesscommonly raised farm animals are not embedded in the character sectionof the modified startup SWF′ file. Therefore, if a game player chooses acharacter that falls into this category, the client will not be able toaccess its content from the modified startup SWF′ file. Instead, theclient needs to explicitly request (e.g., using HTTP requests) theserver to send the content for the character over the network. In thiscase, the game player enjoys a shorter startup time at the beginning ofthe game, but may experience some network latency at a later stage.After the content of the character is received, it is loaded by theapplication for immediate use. The content is also stored locally in thecache, in a file, or memory for later retrieval.

The third location is the local cache, file system, or memory. In theFarmVille example, sometimes the contents for some of the characters arealready stored in the local cache, file system, or memory of the gameplayer's machine (e.g., a laptop or smartphone) before a game isstarted. For example, if the game has been played on the machine before,contents for some of the characters that have been previously fetchedfrom the server can be found in the local cache, file system, or memory.

FIG. 5 is a diagram illustrating an embodiment of a profiling process500 for determining the initial portions of original startup SWF filesthat are sufficient to permit initial functioning of the application inprocess 400. At 502, a subset of client-server connections are selectedfor determining the initial portions of the original startup SWF filesthat are sufficient to permit initial functioning of the application. Insome embodiments, the subset of client-server connections is in partselected based on the connection speed of those connections. Forexample, high-speed connections may be preferred in some embodiments. Insome embodiments, the profiling process 500 is performed during a trialperiod, and the subset of client-server connections corresponds to theconnections made during the trial period.

At 504, for each connection, the player level is determined in partbased on the number of startup SWF files requested by the client. Usingthe FarmVille example, the number of SWF files for starting up the gameon the client side and the content of those SWF files are different fordifferent player levels. Therefore, based on the number of startup SWFfiles requested, the server may determine the player level.

At 506, for each connection, modified SWF′ files are sent with nocharacters embedded in the character sections of the modified SWF′files. Since the modified SWF′ files do not have any characters embeddedin the character sections of the files, the client needs to request forthe characters that the application needs explicitly.

At 508, for each connection, requests for characters from the client arereceived. For example, if the game player chooses to plant a particularcrop and the image file for the crop is not embedded in the charactersections of the modified startup SWF′ files, then the image file isaccessed using a placeholder in one of the modified startup SWF′ files.Assuming that the image file is not found locally, a request for theimage file is sent through the network to the server.

At 510, modified startup SWF′ files are built based on the receivedrequests and the determined player level. For example, if a particularcrop is requested by 70% or more of the connections at player level #2,then the content corresponding to the crop is included in the charactersection of one of the modified startup SWF′ files for player level #2;otherwise, the content corresponding to that crop is not included. Inthis way, modified SWF′ files for different player levels can be builtbased on the collected statistics.

In some embodiments, after the modified startup SWF′ files aredownloaded and the application is up and running, additional resourcescan be pushed from server 308 to client 102. These additional resourcesare pushed to the client even if the client has not specificallyrequested for them. In some embodiments, the profiling process 500 maybe used to determine the resources that are pushed and the order inwhich the resources are pushed. For example, characters that arefrequently requested by game players at a particular player level butare not included in the modified start SWF′ files can be pushed to theclient using this method. For example, characters that are frequentlyrequested at an earlier stage of the player level are pushed earlier.Pushing resources to the client trades increased bandwidth requirementsfor reduced network latency. Therefore, the determination of whether topush resources to the client this way or what kind of resources to pushcan be based on different factors. For example, the determination can bebased on the preferences of the game developer and/or the game player,the speed of the connection, and the machine (e.g., a smartphone orlaptop) on which the application is run.

In some embodiments, server 308 has a local cache for storing thedifferent characters. Compared to other techniques in which the entireSWF file is cached, server 308 caches the characters. In other words,the content granularity of the CDN is a character. If a characterchanges, only the character needs to be distributed, as opposed to theentire SWF file. In some embodiments, the quality of the characters canbe adapted based on the network bandwidth. For example, when theavailable bandwidth is limited, the image file of a character sent in amodified startup SWF′ file can be a compressed image file.

Distributing content dynamically as described above reduces the quantityand the volume of the content that is distributed to the end-users. As aresult, the downloading time and startup time are reduced. Because ofthe reduced network activities, the battery consumption of the userdevices (e.g., phones and tablets) are also reduced. In someembodiments, the client is installed in the firmware of the userdevices, thereby providing faster and improved responses.

Although the foregoing embodiments have been described in some detailfor purposes of clarity of understanding, the invention is not limitedto the details provided. There are many alternative ways of implementingthe invention. The disclosed embodiments are illustrative and notrestrictive.

1. A method of transmitting content from a server to a client executingan application, comprising receiving a request from a client for a filethat includes content related to executing an application; responding tothe request by transmitting a modified file that includes initialportions of the file that are sufficient to permit initial functioningof the application, wherein the modified file is formatted with at leastone placeholder for remaining portions of the file; and wherein theapplication can begin to access the initial portions of the file byaccessing the modified file, and wherein the application can access theremaining portions of the file using the at least one placeholder. 2.The method of claim 1, wherein the initial portions of the file arebased on a state of the application.
 3. The method of claim 2, whereinthe application is a game application, and wherein the state of theapplication is a player level.
 4. The method of claim 1, wherein theinitial portions of the file comprise likely to be used portions of thefile.
 5. The method of claim 4, wherein the likely to be used portionsof the file are determined empirically by the server in a profilingprocess.
 6. The method of claim 5, wherein the profiling processcomprises analyzing behavior of other clients executing the applicationand connected to the server.
 7. The method of claim 1, wherein the fileis a Small Web Format (SWF) file.
 8. The method of claim 1, wherein thefile includes a script, and wherein the modified file includes amodified script.
 9. The method of claim 1, wherein the file includes afirst class, and wherein the modified file includes a second class thatimports the first class.
 10. The method of claim 1, wherein the requestis a HTTP request.
 11. The method of claim 1, wherein accessing any ofthe remaining portions of the file using the at least one placeholdercomprises accessing the portion from one of the following: a cache, afile system, or a memory.
 12. The method of claim 1, wherein accessingany of the remaining portions of the file using the at least oneplaceholder comprises requesting the portion from the server.
 13. Themethod of claim 1, further comprising transmitting a subset of theremaining portions of the file to the client prior to the clientrequesting the subset from the server.
 14. The method of claim 13,wherein the subset is in part based on how likely the subset is used bythe application.
 15. The method of claim 1, wherein the server includesa cache with a content granularity smaller than the file.
 16. A systemfor transmitting content from a server to a client executing anapplication, comprising: a processor configured to: receive a requestfrom a client for a file that includes content related to executing anapplication; respond to the request by transmitting a modified file thatincludes initial portions of the file that are sufficient to permitinitial functioning of the application, wherein the modified file isformatted with at least one placeholder for remaining portions of thefile; and wherein the application can begin to access the initialportions of the file by accessing the modified file, and wherein theapplication can access the remaining portions of the file using the atleast one placeholder; and a memory coupled to the processor andconfigured to provide the processor with instructions.
 17. The system ofclaim 16, wherein the initial portions of the file are based on a stateof the application.
 18. The system of claim 17, wherein the applicationis a game application, and wherein the state of the application is aplayer level.
 19. The system of claim 16, wherein the initial portionsof the file comprise likely to be used portions of the file.
 20. Thesystem of claim 19, wherein the likely to be used portions of the fileare determined empirically by the server in a profiling process.
 21. Thesystem of claim 20, wherein the profiling process comprises analyzingbehavior of other clients executing the application and connected to theserver.
 22. The system of claim 16, wherein the file is a Small WebFormat (SWF) file.
 23. The system of claim 16, wherein the file includesa script, and wherein the modified file includes a modified script. 24.The system of claim 16, wherein the file includes a first class, andwherein the modified file includes a second class that imports the firstclass.
 25. The system of claim 16, wherein the request is a HTTPrequest.
 26. The system of claim 16, wherein accessing any of theremaining portions of the file using the at least one placeholdercomprises accessing the portion from one of the following: a cache, afile system, or a memory.
 27. The system of claim 16, wherein accessingany of the remaining portions of the file using the at least oneplaceholder comprises requesting the portion from the server.
 28. Thesystem of claim 16, wherein the memory is further configured to providethe processor with instructions which when executed cause the processorto transmit a subset of the remaining portions of the file to the clientprior to the client requesting the subset from the server.
 29. Thesystem of claim 28, wherein the subset is in part based on how likelythe subset is used by the application.
 30. The system of claim 16,wherein the server includes a cache with a content granularity smallerthan the file.
 31. A computer program product for transmitting contentfrom a server to a client executing an application, the computer programproduct being embodied in a computer readable storage medium andcomprising computer instructions for: receiving a request from a clientfor a file that includes content related to executing an application;responding to the request by transmitting a modified file that includesinitial portions of the file that are sufficient to permit initialfunctioning of the application, wherein the modified file is formattedwith at least one placeholder for remaining portions of the file; andwherein the application can begin to access the initial portions of thefile by accessing the modified file, and wherein the application canaccess the remaining portions of the file using the at least oneplaceholder.